home *** CD-ROM | disk | FTP | other *** search
- function Pr_Car()
- {
- var _loc3_ = {x:_root.car.pt1._x,y:_root.car.pt1._y};
- _root.car.localToGlobal(_loc3_);
- var _loc2_ = {x:_root.car.pt2._x,y:_root.car.pt2._y};
- _root.car.localToGlobal(_loc2_);
- var _loc9_ = {x:_root.car.pt3._x,y:_root.car.pt3._y};
- _root.car.localToGlobal(_loc9_);
- var _loc8_ = {x:_root.car.pt4._x,y:_root.car.pt4._y};
- _root.car.localToGlobal(_loc8_);
- var _loc4_ = Math.max(_loc3_.x,_loc2_.x);
- _loc4_ = Math.max(_loc4_,_loc9_.x);
- _loc4_ = Math.max(_loc4_,_loc8_.x);
- var _loc6_ = Math.min(_loc3_.x,_loc2_.x);
- _loc6_ = Math.min(_loc6_,_loc9_.x);
- _loc6_ = Math.min(_loc6_,_loc8_.x);
- var _loc5_ = Math.max(_loc3_.y,_loc2_.y);
- _loc5_ = Math.max(_loc5_,_loc9_.y);
- _loc5_ = Math.max(_loc5_,_loc8_.y);
- var _loc7_ = Math.min(_loc3_.y,_loc2_.y);
- _loc7_ = Math.min(_loc7_,_loc9_.y);
- _loc7_ = Math.min(_loc7_,_loc8_.y);
- if(_root.doroga.hitTest(_loc4_,_root.car._y,true))
- {
- _root.car._x -= _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(_loc6_,_root.car._y,true))
- {
- _root.car._x += _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(_root.car._x,_loc5_,true))
- {
- _root.car._y -= _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(_root.car._x,_loc7_,true))
- {
- _root.car._y += _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- }
- function MoveAll(nextl)
- {
- speed = 3;
- speedbot = 3.5;
- speed2 = 0.4;
- otkl = 6;
- if(p < 2)
- {
- car.flame.gotoAndStop(1);
- netrofl = false;
- if(_root.netro.dwn)
- {
- _root.netro.gotoAndPlay(1);
- _root.msnd.Playsnd(4);
- }
- }
- if(p > 0)
- {
- if(_root.netrofl)
- {
- spm.speed._rotation = 85;
- }
- else
- {
- spm.speed._rotation = p * 50 - 90;
- }
- }
- if(p < 0)
- {
- spm.speed._rotation = (- p) * 10 - 90;
- }
- gameDate = new Date();
- sec = gameDate.getSeconds();
- min = gameDate.getMinutes();
- mls = int(gameDate.getMilliseconds() / 10);
- if(mls < 10)
- {
- mls = "0" + mls;
- }
- gts = sec - startsec;
- gtm = min - startmin;
- if(gtm < 0)
- {
- gtmp = gtm + 60;
- }
- else
- {
- gtmp = gtm;
- }
- if(gts < 0)
- {
- gtsl = gts + 60;
- }
- else
- {
- gtsl = gts;
- }
- if(gts < 10 and gts > -1)
- {
- gtsl = "0" + gtsl;
- }
- if(gtsl == 0)
- {
- gtml = gtmp;
- }
- if(gtml < 1)
- {
- time = "00:" + gtsl + ":" + mls;
- }
- else
- {
- time = gtml + ":" + gtsl + ":" + mls;
- }
- if(p < 0.05 && p > 0.049 || p < 0.02 && p > 0.019 || p < 0.04 && p > 0.039 || p < 0.03 && p > 0.029 || p < 0.01 && p > 0.009 || p < 0.01 && p > 0)
- {
- p = 0;
- }
- car._x += p * Math.cos(0.017453292519943295 * _root.rotcar);
- car._y += p * Math.sin(0.017453292519943295 * _root.rotcar);
- car2._x += p2 * Math.cos(0.017453292519943295 * _root.rotcar2);
- car2._y += p2 * Math.sin(0.017453292519943295 * _root.rotcar2);
- car3._x += p3 * Math.cos(0.017453292519943295 * _root.rotcar3);
- car3._y += p3 * Math.sin(0.017453292519943295 * _root.rotcar3);
- car4._x += p4 * Math.cos(0.017453292519943295 * _root.rotcar4);
- car4._y += p4 * Math.sin(0.017453292519943295 * _root.rotcar4);
- rotcar = getProperty("/car", _rotation);
- rotcar2 = getProperty("/car2", _rotation);
- rotcar3 = getProperty("/car3", _rotation);
- rotcar4 = getProperty("/car4", _rotation);
- prov._x = car._x;
- prov._y = car._y;
- prov._rotation = car._rotation;
- prov._visible = 0;
- if(p > 0)
- {
- if(car.hitTest("/fon"))
- {
- p -= 0.02;
- }
- }
- if(p < 0)
- {
- if(car.hitTest("/fon"))
- {
- p += 0.02;
- }
- }
- if(p2 < 0)
- {
- if(car2.hitTest("/fon"))
- {
- p2 += 0.02;
- }
- }
- if(p3 < 0)
- {
- if(car3.hitTest("/fon"))
- {
- p3 += 0.02;
- }
- }
- if(p4 < 0)
- {
- if(car4.hitTest("/fon"))
- {
- p4 += 0.02;
- }
- }
- }
- function MyCarSelect(col)
- {
- col2 = col + 1;
- if(col2 > 4)
- {
- col2 = 1;
- }
- col3 = col2 + 1;
- if(col3 > 4)
- {
- col3 = 1;
- }
- col4 = col3 + 1;
- if(col4 > 4)
- {
- col4 = 1;
- }
- _root.car.gotoAndStop(col);
- _root.car2.gotoAndStop(col2);
- _root.car3.gotoAndStop(col3);
- _root.car4.gotoAndStop(col4);
- }
- function SetEndTime()
- {
- stoptime2 = new Date();
- secstop2 = stoptime2.getSeconds();
- minstop2 = stoptime2.getMinutes();
- ssl2 = secstop2 - startsec;
- msl2 = minstop2 - startmin;
- if(msl2 < 0)
- {
- mslp2 = msl2 + 60 - 1;
- }
- else
- {
- mslp2 = msl2 - 1;
- }
- if(ssl2 < 0)
- {
- sslp2 = ssl2 + 60;
- }
- else
- {
- sslp2 = ssl2;
- }
- if(mslp2 < 1)
- {
- _root.timelast2 = sslp2 + "sec";
- }
- else
- {
- _root.timelast2 = mslp2 + "min" + " " + sslp2 + "sec";
- }
- }
- function CarBot2(ll)
- {
- rand = random(ll) * 0.03;
- if(_root.p2 < _root.speed + rand)
- {
- _root.p2 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car3)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- with(_root.car4)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function CarBot3(ll)
- {
- rand = random(ll) * 0.03;
- if(_root.p3 < _root.speed + rand)
- {
- _root.p3 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car2)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- with(_root.car4)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function CarBot4(ll)
- {
- rand = random(ll) * 0.03;
- if(_root.p4 < _root.speed + rand)
- {
- _root.p4 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car2)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car3)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function SetEndGame()
- {
- stopAllSounds();
- laps = "5";
- netrofl = false;
- stay = 1;
- t = 15;
- p = 0;
- p2 = 0;
- p3 = 0;
- p4 = 0;
- lap = 1;
- lap2 = 1;
- lap3 = 1;
- lap4 = 1;
- po1 = 0;
- po2 = 0;
- po3 = 0;
- pob3_2 = 0;
- pob3_3 = 0;
- pob3_4 = 0;
- ran = random(10);
- netro.gotoAndStop(1);
- car.flame.gotoAndStop(1);
- }
- if(map == 2)
- {
- gotoAndStop("to2");
- play();
- }
- if(map == 3)
- {
- gotoAndStop("to3");
- play();
- }
- if(map == 4)
- {
- gotoAndStop("to4");
- play();
- }
- if(map == 5)
- {
- gotoAndStop("to5");
- play();
- }
-